package com.dhc.appbusinessfrm.model;

import com.dhc.appbusinessfrm.R;

/**
 * Created by xy on 2015/6/29.
 */
public enum MsgParseEnum {

    none(0, 0),

    net_unexpected(-3, R.string.net_unexpected),

    net_conversion(-3, R.string.net_conversion),

    net_error(-2, R.string.net_error),

    http_error(-1, R.string.http_error),

    http_timeout(302, R.string.timeout_error),

    common_100(100, R.string.common_error_100),

    common_102(102, R.string.common_error_102),

    common_103(103, R.string.common_error_103),


    login_1010(1010, R.string.login_error_1010),

    login_1011(1011, R.string.login_error_1011),

    login_1012(1012, R.string.login_error_1012),

    order_list_1020(1020, R.string.order_list_error_1020),

    order_detail_1030(1030, R.string.order_detail_error_1030),

    order_status_1040(1040, R.string.order_status_error_1040),

    order_status_1041(1041, R.string.order_status_error_1041),

    order_status_1042(1042, R.string.order_status_error_1042),

    order_count_1080(1080, R.string.order_count_error_1080),

    merchandises_list_1050(1050, R.string.merchandises_list_error_1050),

    brand_list_1090(1090, R.string.brand_list_error_1090),

    check_password_is_invalid_1301(1301,
            R.string.check_password_is_invalid_error_1301),

    check_password_is_invalid_1300(1300,
            R.string.check_password_is_invalid_error_1300),

    modify_password_1400(1400, R.string.modify_password_error_1400);


    private int value;
    private int index;

    private MsgParseEnum(int index, int value) {
        this.index = index;
        this.value = value;
    }

    public static int getValue(int index) {
        for (MsgParseEnum p : MsgParseEnum.values()) {
            if (p.getIndex() == index) {
                return p.value;
            }
        }
        return -1;
    }

    public int getValue() {
        return value;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}

